from dataclasses import dataclass
from abc import ABC
from typing import Optional, List, Dict, Any

from langchain.chains.base import Chain
from langchain_community.chat_models import ChatOpenAI
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.language_models import BaseChatModel
from langchain_core.runnables import RunnableSerializable
from pydantic import Field, Extra, BaseModel


class BaseChain(Chain, ABC):
    api_base: str = "",
    api_version: str = "",
    api_key: str = "",

    @classmethod
    def from_llm(cls,
                 api_base: str = "",
                 api_version: str = "",
                 api_key: str = ""):
        return cls(api_base=api_base, api_version=api_version, api_key=api_key)


